<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>InfCertificateChain</title>
<meta name="generator" content="DocBook XSL Stylesheets V1.76.0">
<link rel="home" href="index.html" title="libinfinity-0.4 Reference Manual">
<link rel="up" href="ch02.html" title="Common libinfinity API">
<link rel="prev" href="InfStandaloneIo.html" title="InfStandaloneIo">
<link rel="next" href="libinfinity-0.4-InfXmlUtil.html" title="XML utility functions">
<meta name="generator" content="GTK-Doc V1.15 (XML mode)">
<link rel="stylesheet" href="style.css" type="text/css">
</head>
<body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF">
<table class="navigation" id="top" width="100%" summary="Navigation header" cellpadding="2" cellspacing="2">
<tr valign="middle">
<td><a accesskey="p" href="InfStandaloneIo.html"><img src="left.png" width="24" height="24" border="0" alt="Prev"></a></td>
<td><a accesskey="u" href="ch02.html"><img src="up.png" width="24" height="24" border="0" alt="Up"></a></td>
<td><a accesskey="h" href="index.html"><img src="home.png" width="24" height="24" border="0" alt="Home"></a></td>
<th width="100%" align="center">libinfinity-0.4 Reference Manual</th>
<td><a accesskey="n" href="libinfinity-0.4-InfXmlUtil.html"><img src="right.png" width="24" height="24" border="0" alt="Next"></a></td>
</tr>
<tr><td colspan="5" class="shortcuts">
<a href="#libinfinity-0.4-InfCertificateChain.synopsis" class="shortcut">Top</a>
                   | 
                  <a href="#libinfinity-0.4-InfCertificateChain.description" class="shortcut">Description</a>
</td></tr>
</table>
<div class="refentry" title="InfCertificateChain">
<a name="libinfinity-0.4-InfCertificateChain"></a><div class="titlepage"></div>
<div class="refnamediv"><table width="100%"><tr>
<td valign="top">
<h2><span class="refentrytitle"><a name="libinfinity-0.4-InfCertificateChain.top_of_page"></a>InfCertificateChain</span></h2>
<p>InfCertificateChain — X.509 certificate chains</p>
</td>
<td valign="top" align="right"></td>
</tr></table></div>
<div class="refsect1" title="Stability Level">
<a name="libinfinity-0.4-InfCertificateChain.stability-level"></a><h2>Stability Level</h2>
Unstable, unless otherwise indicated
</div>
<div class="refsynopsisdiv" title="Synopsis">
<a name="libinfinity-0.4-InfCertificateChain.synopsis"></a><h2>Synopsis</h2>
<pre class="synopsis">
#include &lt;libinfinity/common/inf-certificate-chain.h&gt;

                    <a class="link" href="libinfinity-0.4-InfCertificateChain.html#InfCertificateChain" title="InfCertificateChain">InfCertificateChain</a>;
<a class="link" href="libinfinity-0.4-InfCertificateChain.html#InfCertificateChain" title="InfCertificateChain"><span class="returnvalue">InfCertificateChain</span></a> * <a class="link" href="libinfinity-0.4-InfCertificateChain.html#inf-certificate-chain-new" title="inf_certificate_chain_new ()">inf_certificate_chain_new</a>         (<em class="parameter"><code><a href="/usr/share/gtk-doc/html/gnutls/gnutls-gnutls.html#gnutls-x509-crt-t"><span class="type">gnutls_x509_crt_t</span></a> *certs</code></em>,
                                                         <em class="parameter"><code><a href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#guint"><span class="type">guint</span></a> n_certs</code></em>);
<a class="link" href="libinfinity-0.4-InfCertificateChain.html#InfCertificateChain" title="InfCertificateChain"><span class="returnvalue">InfCertificateChain</span></a> * <a class="link" href="libinfinity-0.4-InfCertificateChain.html#inf-certificate-chain-ref" title="inf_certificate_chain_ref ()">inf_certificate_chain_ref</a>         (<em class="parameter"><code><a class="link" href="libinfinity-0.4-InfCertificateChain.html#InfCertificateChain" title="InfCertificateChain"><span class="type">InfCertificateChain</span></a> *chain</code></em>);
<span class="returnvalue">void</span>                <a class="link" href="libinfinity-0.4-InfCertificateChain.html#inf-certificate-chain-unref" title="inf_certificate_chain_unref ()">inf_certificate_chain_unref</a>         (<em class="parameter"><code><a class="link" href="libinfinity-0.4-InfCertificateChain.html#InfCertificateChain" title="InfCertificateChain"><span class="type">InfCertificateChain</span></a> *chain</code></em>);
<a href="/usr/share/gtk-doc/html/gnutls/gnutls-gnutls.html#gnutls-x509-crt-t"><span class="returnvalue">gnutls_x509_crt_t</span></a> * <a class="link" href="libinfinity-0.4-InfCertificateChain.html#inf-certificate-chain-get-raw" title="inf_certificate_chain_get_raw ()">inf_certificate_chain_get_raw</a>       (<em class="parameter"><code>const <a class="link" href="libinfinity-0.4-InfCertificateChain.html#InfCertificateChain" title="InfCertificateChain"><span class="type">InfCertificateChain</span></a> *chain</code></em>);
<a href="/usr/share/gtk-doc/html/gnutls/gnutls-gnutls.html#gnutls-x509-crt-t"><span class="returnvalue">gnutls_x509_crt_t</span></a>   <a class="link" href="libinfinity-0.4-InfCertificateChain.html#inf-certificate-chain-get-root-certificate" title="inf_certificate_chain_get_root_certificate ()">inf_certificate_chain_get_root_certificate</a>
                                                        (<em class="parameter"><code>const <a class="link" href="libinfinity-0.4-InfCertificateChain.html#InfCertificateChain" title="InfCertificateChain"><span class="type">InfCertificateChain</span></a> *chain</code></em>);
<a href="/usr/share/gtk-doc/html/gnutls/gnutls-gnutls.html#gnutls-x509-crt-t"><span class="returnvalue">gnutls_x509_crt_t</span></a>   <a class="link" href="libinfinity-0.4-InfCertificateChain.html#inf-certificate-chain-get-own-certificate" title="inf_certificate_chain_get_own_certificate ()">inf_certificate_chain_get_own_certificate</a>
                                                        (<em class="parameter"><code>const <a class="link" href="libinfinity-0.4-InfCertificateChain.html#InfCertificateChain" title="InfCertificateChain"><span class="type">InfCertificateChain</span></a> *chain</code></em>);
<a href="/usr/share/gtk-doc/html/gnutls/gnutls-gnutls.html#gnutls-x509-crt-t"><span class="returnvalue">gnutls_x509_crt_t</span></a>   <a class="link" href="libinfinity-0.4-InfCertificateChain.html#inf-certificate-chain-get-nth-certificate" title="inf_certificate_chain_get_nth_certificate ()">inf_certificate_chain_get_nth_certificate</a>
                                                        (<em class="parameter"><code>const <a class="link" href="libinfinity-0.4-InfCertificateChain.html#InfCertificateChain" title="InfCertificateChain"><span class="type">InfCertificateChain</span></a> *chain</code></em>,
                                                         <em class="parameter"><code><a href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#guint"><span class="type">guint</span></a> n</code></em>);
<a href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#guint"><span class="returnvalue">guint</span></a>               <a class="link" href="libinfinity-0.4-InfCertificateChain.html#inf-certificate-chain-get-n-certificates" title="inf_certificate_chain_get_n_certificates ()">inf_certificate_chain_get_n_certificates</a>
                                                        (<em class="parameter"><code>const <a class="link" href="libinfinity-0.4-InfCertificateChain.html#InfCertificateChain" title="InfCertificateChain"><span class="type">InfCertificateChain</span></a> *chain</code></em>);
</pre>
</div>
<div class="refsect1" title="Description">
<a name="libinfinity-0.4-InfCertificateChain.description"></a><h2>Description</h2>
<p>
<a class="link" href="libinfinity-0.4-InfCertificateChain.html#InfCertificateChain" title="InfCertificateChain"><span class="type">InfCertificateChain</span></a> is a reference-counted wrapper around an array of 
gnutls_x509_crt_t structures, representing a certificate chain.
</p>
</div>
<div class="refsect1" title="Details">
<a name="libinfinity-0.4-InfCertificateChain.details"></a><h2>Details</h2>
<div class="refsect2" title="InfCertificateChain">
<a name="InfCertificateChain"></a><h3>InfCertificateChain</h3>
<pre class="programlisting">typedef struct _InfCertificateChain InfCertificateChain;</pre>
<p>
<span class="type">InfCertifiacteChain</span> is an opaque data type. You should only access it
via the public API functions.
</p>
</div>
<hr>
<div class="refsect2" title="inf_certificate_chain_new ()">
<a name="inf-certificate-chain-new"></a><h3>inf_certificate_chain_new ()</h3>
<pre class="programlisting"><a class="link" href="libinfinity-0.4-InfCertificateChain.html#InfCertificateChain" title="InfCertificateChain"><span class="returnvalue">InfCertificateChain</span></a> * inf_certificate_chain_new         (<em class="parameter"><code><a href="/usr/share/gtk-doc/html/gnutls/gnutls-gnutls.html#gnutls-x509-crt-t"><span class="type">gnutls_x509_crt_t</span></a> *certs</code></em>,
                                                         <em class="parameter"><code><a href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#guint"><span class="type">guint</span></a> n_certs</code></em>);</pre>
<p>
Creates a new <a class="link" href="libinfinity-0.4-InfCertificateChain.html#InfCertificateChain" title="InfCertificateChain"><span class="type">InfCertificateChain</span></a> with the given certificates. The <em class="parameter"><code>certs</code></em>
array needs to be allocated with g_malloc. This function takes ownership
of <em class="parameter"><code>certs</code></em>.
</p>
<div class="variablelist"><table border="0">
<col align="left" valign="top">
<tbody>
<tr>
<td><p><span class="term"><em class="parameter"><code>certs</code></em> :</span></p></td>
<td>Array of certificates.
</td>
</tr>
<tr>
<td><p><span class="term"><em class="parameter"><code>n_certs</code></em> :</span></p></td>
<td>Number of elements in <em class="parameter"><code>certs</code></em>.
</td>
</tr>
<tr>
<td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
<td> A new <a class="link" href="libinfinity-0.4-InfCertificateChain.html#InfCertificateChain" title="InfCertificateChain"><span class="type">InfCertificateChain</span></a>.
</td>
</tr>
</tbody>
</table></div>
</div>
<hr>
<div class="refsect2" title="inf_certificate_chain_ref ()">
<a name="inf-certificate-chain-ref"></a><h3>inf_certificate_chain_ref ()</h3>
<pre class="programlisting"><a class="link" href="libinfinity-0.4-InfCertificateChain.html#InfCertificateChain" title="InfCertificateChain"><span class="returnvalue">InfCertificateChain</span></a> * inf_certificate_chain_ref         (<em class="parameter"><code><a class="link" href="libinfinity-0.4-InfCertificateChain.html#InfCertificateChain" title="InfCertificateChain"><span class="type">InfCertificateChain</span></a> *chain</code></em>);</pre>
<p>
Increases the reference count of <em class="parameter"><code>chain</code></em> by one.
</p>
<div class="variablelist"><table border="0">
<col align="left" valign="top">
<tbody>
<tr>
<td><p><span class="term"><em class="parameter"><code>chain</code></em> :</span></p></td>
<td>A <a class="link" href="libinfinity-0.4-InfCertificateChain.html#InfCertificateChain" title="InfCertificateChain"><span class="type">InfCertificateChain</span></a>:
</td>
</tr>
<tr>
<td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
<td> The same <em class="parameter"><code>chain</code></em>.
</td>
</tr>
</tbody>
</table></div>
</div>
<hr>
<div class="refsect2" title="inf_certificate_chain_unref ()">
<a name="inf-certificate-chain-unref"></a><h3>inf_certificate_chain_unref ()</h3>
<pre class="programlisting"><span class="returnvalue">void</span>                inf_certificate_chain_unref         (<em class="parameter"><code><a class="link" href="libinfinity-0.4-InfCertificateChain.html#InfCertificateChain" title="InfCertificateChain"><span class="type">InfCertificateChain</span></a> *chain</code></em>);</pre>
<p>
Decreases the reference count of <em class="parameter"><code>chain</code></em> by one. If the reference count
reaches zero, then <em class="parameter"><code>chain</code></em> is freed.
</p>
<div class="variablelist"><table border="0">
<col align="left" valign="top">
<tbody><tr>
<td><p><span class="term"><em class="parameter"><code>chain</code></em> :</span></p></td>
<td>A <a class="link" href="libinfinity-0.4-InfCertificateChain.html#InfCertificateChain" title="InfCertificateChain"><span class="type">InfCertificateChain</span></a>.
</td>
</tr></tbody>
</table></div>
</div>
<hr>
<div class="refsect2" title="inf_certificate_chain_get_raw ()">
<a name="inf-certificate-chain-get-raw"></a><h3>inf_certificate_chain_get_raw ()</h3>
<pre class="programlisting"><a href="/usr/share/gtk-doc/html/gnutls/gnutls-gnutls.html#gnutls-x509-crt-t"><span class="returnvalue">gnutls_x509_crt_t</span></a> * inf_certificate_chain_get_raw       (<em class="parameter"><code>const <a class="link" href="libinfinity-0.4-InfCertificateChain.html#InfCertificateChain" title="InfCertificateChain"><span class="type">InfCertificateChain</span></a> *chain</code></em>);</pre>
<p>
Returns the raw array of certificates in the chain.
</p>
<div class="variablelist"><table border="0">
<col align="left" valign="top">
<tbody>
<tr>
<td><p><span class="term"><em class="parameter"><code>chain</code></em> :</span></p></td>
<td>A <a class="link" href="libinfinity-0.4-InfCertificateChain.html#InfCertificateChain" title="InfCertificateChain"><span class="type">InfCertificateChain</span></a>.
</td>
</tr>
<tr>
<td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
<td> An array of certificates owned by the chain.
</td>
</tr>
</tbody>
</table></div>
</div>
<hr>
<div class="refsect2" title="inf_certificate_chain_get_root_certificate ()">
<a name="inf-certificate-chain-get-root-certificate"></a><h3>inf_certificate_chain_get_root_certificate ()</h3>
<pre class="programlisting"><a href="/usr/share/gtk-doc/html/gnutls/gnutls-gnutls.html#gnutls-x509-crt-t"><span class="returnvalue">gnutls_x509_crt_t</span></a>   inf_certificate_chain_get_root_certificate
                                                        (<em class="parameter"><code>const <a class="link" href="libinfinity-0.4-InfCertificateChain.html#InfCertificateChain" title="InfCertificateChain"><span class="type">InfCertificateChain</span></a> *chain</code></em>);</pre>
<p>
Returns the last certificate in the chain.
</p>
<div class="variablelist"><table border="0">
<col align="left" valign="top">
<tbody>
<tr>
<td><p><span class="term"><em class="parameter"><code>chain</code></em> :</span></p></td>
<td>A <a class="link" href="libinfinity-0.4-InfCertificateChain.html#InfCertificateChain" title="InfCertificateChain"><span class="type">InfCertificateChain</span></a>.
</td>
</tr>
<tr>
<td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
<td> The last certificate in the chain.
</td>
</tr>
</tbody>
</table></div>
</div>
<hr>
<div class="refsect2" title="inf_certificate_chain_get_own_certificate ()">
<a name="inf-certificate-chain-get-own-certificate"></a><h3>inf_certificate_chain_get_own_certificate ()</h3>
<pre class="programlisting"><a href="/usr/share/gtk-doc/html/gnutls/gnutls-gnutls.html#gnutls-x509-crt-t"><span class="returnvalue">gnutls_x509_crt_t</span></a>   inf_certificate_chain_get_own_certificate
                                                        (<em class="parameter"><code>const <a class="link" href="libinfinity-0.4-InfCertificateChain.html#InfCertificateChain" title="InfCertificateChain"><span class="type">InfCertificateChain</span></a> *chain</code></em>);</pre>
<p>
TODO: Rename this function into something more appropriate.
</p>
<p>
Returns the first certificate in the chain.
</p>
<div class="variablelist"><table border="0">
<col align="left" valign="top">
<tbody>
<tr>
<td><p><span class="term"><em class="parameter"><code>chain</code></em> :</span></p></td>
<td>A <a class="link" href="libinfinity-0.4-InfCertificateChain.html#InfCertificateChain" title="InfCertificateChain"><span class="type">InfCertificateChain</span></a>.
</td>
</tr>
<tr>
<td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
<td> The first certificate in the chain.
</td>
</tr>
</tbody>
</table></div>
</div>
<hr>
<div class="refsect2" title="inf_certificate_chain_get_nth_certificate ()">
<a name="inf-certificate-chain-get-nth-certificate"></a><h3>inf_certificate_chain_get_nth_certificate ()</h3>
<pre class="programlisting"><a href="/usr/share/gtk-doc/html/gnutls/gnutls-gnutls.html#gnutls-x509-crt-t"><span class="returnvalue">gnutls_x509_crt_t</span></a>   inf_certificate_chain_get_nth_certificate
                                                        (<em class="parameter"><code>const <a class="link" href="libinfinity-0.4-InfCertificateChain.html#InfCertificateChain" title="InfCertificateChain"><span class="type">InfCertificateChain</span></a> *chain</code></em>,
                                                         <em class="parameter"><code><a href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#guint"><span class="type">guint</span></a> n</code></em>);</pre>
<p>
Returns the <em class="parameter"><code>n</code></em>th certificate in the chain.
</p>
<div class="variablelist"><table border="0">
<col align="left" valign="top">
<tbody>
<tr>
<td><p><span class="term"><em class="parameter"><code>chain</code></em> :</span></p></td>
<td>A <a class="link" href="libinfinity-0.4-InfCertificateChain.html#InfCertificateChain" title="InfCertificateChain"><span class="type">InfCertificateChain</span></a>.
</td>
</tr>
<tr>
<td><p><span class="term"><em class="parameter"><code>n</code></em> :</span></p></td>
<td>Index of the certificate to retrieve.
</td>
</tr>
<tr>
<td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
<td> The nth certificate in the chain.
</td>
</tr>
</tbody>
</table></div>
</div>
<hr>
<div class="refsect2" title="inf_certificate_chain_get_n_certificates ()">
<a name="inf-certificate-chain-get-n-certificates"></a><h3>inf_certificate_chain_get_n_certificates ()</h3>
<pre class="programlisting"><a href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#guint"><span class="returnvalue">guint</span></a>               inf_certificate_chain_get_n_certificates
                                                        (<em class="parameter"><code>const <a class="link" href="libinfinity-0.4-InfCertificateChain.html#InfCertificateChain" title="InfCertificateChain"><span class="type">InfCertificateChain</span></a> *chain</code></em>);</pre>
<p>
</p>
<div class="variablelist"><table border="0">
<col align="left" valign="top">
<tbody>
<tr>
<td><p><span class="term"><em class="parameter"><code>chain</code></em> :</span></p></td>
<td>
</td>
</tr>
<tr>
<td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
<td>
</td>
</tr>
</tbody>
</table></div>
</div>
</div>
<div class="refsect1" title="See Also">
<a name="libinfinity-0.4-InfCertificateChain.see-also"></a><h2>See Also</h2>
<a class="link" href="InfXmppConnection.html" title="InfXmppConnection"><span class="type">InfXmppConnection</span></a>
</div>
</div>
<div class="footer">
<hr>
          Generated by GTK-Doc V1.15</div>
</body>
</html>